<!DOCTYPE html> <html> <head> <title>Float</title> <style> .floatLeft { float:left; } .floatRight{ float:right; } #redBox { height:100px; width:200px; background-color:#F00; color:#FFF; } #blueBox { height:150px; width:150px; background-color:#00F; color:#FFF; } </style> </head> <body> <!-- Block elementer kan ryge ind under hinanden, modsat inline elementer --> <div id="redBox" class="floatLeft">Red Box</div> <div id="blueBox" class="floatRight">Blue Box</div> <!-- inline elementer lægger sig ved siden af hinanden, selv hvis kun det første element floater. --> <!-- <p class="floatLeft">1. Lorem ipsum dolor sit amet, consectetur adipiscing elit. </p> <p>2. Lorem ipsum dolor sit amet, consectetur adipiscing elit. </p> --> </body> </html>